﻿#region directives

using Toodledo.Client;
using Toodledo.Model.API;

#endregion

namespace ToodleDo
{
    public static class Remote
    {
        private static Session _session;

        public static IGeneral General
        {
            get { return _session != null ? _session : null; }
        }

        public static ITasks Tasks
        {
            get { return _session != null ? _session : null; }
        }

        public static IAuthentication Authentication
        {
            get { return _session != null ? _session : null; }
        }

        public static Session Session
        {
            get { return _session; }
        }

        public static void Init(string userid, string password, string appid, string apptoken)
        {
            _session = Session.Create(userid, password, appid, apptoken);
            Logger.InvokeMessageEvent("Session Initiated", Logger.MessageType.Tracking);
        }
    }
}